<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{advWarnDataAction}" />
	
	<span class="pagetitle">市场数据分析 —— 广告异常数据</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<h:outputLabel id="radioHide" value="#{bean.dateRadio}" style="visibility: hidden"/>
	
	    <p:outputPanel id="customPanel" style="margin-bottom:10px">
	        <p:selectOneRadio id="customRadio" value="#{bean.dateRadio}" layout="custom">
	            <f:selectItem itemLabel="0" itemValue="0" />
	            <f:selectItem itemLabel="1" itemValue="1" />
	            <f:selectItem itemLabel="3" itemValue="3" />
	            <f:selectItem itemLabel="7" itemValue="7" />
	            <f:selectItem itemLabel="-1" itemValue="-1" />
	     	</p:selectOneRadio>
	 
	        <h:panelGrid id="opt" columns="20" cellpadding="8">
	            <p:radioButton id="opt5" for="customRadio" itemIndex="0" /> 
	            <h:outputLabel for="opt5" value="今天" />
	            <h:outputLabel />
	            
	            <p:radioButton id="opt1" for="customRadio" itemIndex="1" /> 
	            <h:outputLabel for="opt1" value="近1天" />
	            <h:outputLabel />
	 
	            <p:radioButton id="opt2" for="customRadio" itemIndex="2" />
	            <h:outputLabel for="opt2" value="近3天" />
	            <h:outputLabel />
	 
	            <p:radioButton id="opt3" for="customRadio" itemIndex="3" />
	            <h:outputLabel for="opt3" value="近7天" />
	            <h:outputLabel />
	             
	            <p:radioButton id="opt4" for="customRadio" itemIndex="4" />
	            <h:outputLabel for="opt4" value="自定义 开始时间" />
           	 	<p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd">
           	 	</p:calendar>
				<h:outputLabel for="opt4" value="结束时间" />
				<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd">
				</p:calendar>
	        </h:panelGrid>
	        <h:panelGrid columns="9">
		        <p:selectCheckboxMenu id="menuChannelName" value="#{bean.selectedChannelName}" label="渠道名称"
		                              filter="true" filterMatchMode="startsWith" style="width:150px">
		            <f:selectItems value="#{bean.channelName}" />
		        </p:selectCheckboxMenu>
		        <p:selectCheckboxMenu id="menuAgent" value="#{bean.selectedAgent}" label="代理商"
		                              filter="true" filterMatchMode="startsWith" style="width:150px">
		            <f:selectItems value="#{bean.agent}" />
		        </p:selectCheckboxMenu>
		        <p:selectCheckboxMenu id="menuPlatform" value="#{bean.selectedPlatform}" label="平台"
		                              filter="true" filterMatchMode="startsWith" style="width:150px">
		            <f:selectItems value="#{bean.platform}" />
		        </p:selectCheckboxMenu>
        		<p:commandButton  id="ajax" value="查询" update=":#{p:component('dform')} :fsearch" action="#{bean.search()}"/>
			    </h:panelGrid>
	    </p:outputPanel>

        <p:growl id="growl" showDetail="true" sticky="true" />
	</h:form>
	<br />
	
	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<h:panelGrid columns="1" style="width:100%">
             <div id="basewidth" style="width:92%;height:0; border:0;" />
        </h:panelGrid>
		<div class="data" id="data">
			<p:panel id="panel" header="详细数据" style="margin-bottom:10px;">
				<p:tabView>
				    <p:tab title="异常数据概况" id="active">
			    		<p:dataTable id="dlist1" var="l" value="#{bean.warningDatas0}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
							<f:facet name="{Exporters}">
								<h:commandLink styleClass="exporter">
							        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
							        <p:dataExporter type="xls" target="dlist1" fileName="instanceStayActiveRadios-#{pageHelper.getNewDateDetailStr()}" />
							    </h:commandLink>
							</f:facet>
							<p:column headerText="日期"   sortBy="#{l.logday}">
								<h:outputLabel value="#{l.logday}" />
							</p:column>
							<p:column headerText="渠道名称"   sortBy="#{l.channelName}">
								<h:outputLabel value="#{l.channelName}" />
							</p:column>
							<p:column headerText="代理公司"   sortBy="#{l.agent}">
								<h:outputLabel value="#{l.agent}" />
							</p:column>
							<p:column headerText="广告激活设备"   sortBy="#{l.active}">
								<h:outputLabel value="#{l.active}" />
							</p:column>
							<p:column headerText="异常激活设备"  sortBy="#{l.warnActice}">
								<h:outputLabel value="#{l.warnActice}" />
							</p:column>
							<p:column headerText="异常激活率"  sortBy="#{l.rate}">
								<h:outputLabel value="#{l.rate}" />
							</p:column>
						</p:dataTable>
				    </p:tab>
				   
				    <p:tab title="同IP激活" id="activeip">
			    		<p:dataTable id="dlist2" var="l" value="#{bean.warningDatas1}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
							<f:facet name="{Exporters}">
								<h:commandLink styleClass="exporter">
							        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
							        <p:dataExporter type="xls" target="dlist2" fileName="instanceStayActiveRadios-#{pageHelper.getNewDateDetailStr()}" />
							    </h:commandLink>
							</f:facet>
							<p:column headerText="日期"   sortBy="#{l.logday}">
								<h:outputLabel value="#{l.logday}" />
							</p:column>
							<p:column headerText="渠道名称"   sortBy="#{l.channelName}">
								<h:outputLabel value="#{l.channelName}" />
							</p:column>
							<p:column headerText="代理公司"   sortBy="#{l.agent}">
								<h:outputLabel value="#{l.agent}" />
							</p:column>
							<p:column headerText="广告激活设备"   sortBy="#{l.active}">
								<h:outputLabel value="#{l.active}" />
							</p:column>
							<p:column headerText="异常激活设备"  sortBy="#{l.warnActice}">
								<h:outputLabel value="#{l.warnActice}" />
							</p:column>
							<p:column headerText="异常激活率"  sortBy="#{l.rate}">
								<h:outputLabel value="#{l.rate}" />
							</p:column>
						</p:dataTable>
				    </p:tab>
				    
				    <p:tab title="异常设备" id="activeuser">
			    		<p:dataTable id="dlist3" var="l" value="#{bean.warningDatas2}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
							<f:facet name="{Exporters}">
								<h:commandLink styleClass="exporter">
							        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
							        <p:dataExporter type="xls" target="dlist3" fileName="instanceStayActiveRadios-#{pageHelper.getNewDateDetailStr()}" />
							    </h:commandLink>
							</f:facet>
							<p:column headerText="日期"   sortBy="#{l.logday}">
								<h:outputLabel value="#{l.logday}" />
							</p:column>
							<p:column headerText="渠道名称"   sortBy="#{l.channelName}">
								<h:outputLabel value="#{l.channelName}" />
							</p:column>
							<p:column headerText="代理公司"   sortBy="#{l.agent}">
								<h:outputLabel value="#{l.agent}" />
							</p:column>
							<p:column headerText="广告激活设备"   sortBy="#{l.active}">
								<h:outputLabel value="#{l.active}" />
							</p:column>
							<p:column headerText="异常激活设备"  sortBy="#{l.warnActice}">
								<h:outputLabel value="#{l.warnActice}" />
							</p:column>
							<p:column headerText="异常激活率"  sortBy="#{l.rate}">
								<h:outputLabel value="#{l.rate}" />
							</p:column>
						</p:dataTable>
				    </p:tab>
				    
				    <p:tab title="异常库匹配" id="activein">
			    		<p:dataTable id="dlist4" var="l" value="#{bean.warningDatas3}" scrollable="true" resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} {Exporters}" rowsPerPageTemplate="15,30" rows="15" style="text-align:center;">
							<f:facet name="{Exporters}">
								<h:commandLink styleClass="exporter">
							        <p:graphicImage url="/resources/images/excel.png" height="25px"/>
							        <p:dataExporter type="xls" target="dlist4" fileName="instanceStayActiveRadios-#{pageHelper.getNewDateDetailStr()}" />
							    </h:commandLink>
							</f:facet>
							<p:column headerText="日期"   sortBy="#{l.logday}">
								<h:outputLabel value="#{l.logday}" />
							</p:column>
							<p:column headerText="渠道名称"   sortBy="#{l.channelName}">
								<h:outputLabel value="#{l.channelName}" />
							</p:column>
							<p:column headerText="代理公司"   sortBy="#{l.agent}">
								<h:outputLabel value="#{l.agent}" />
							</p:column>
							<p:column headerText="广告激活设备"   sortBy="#{l.active}">
								<h:outputLabel value="#{l.active}" />
							</p:column>
							<p:column headerText="异常激活设备"  sortBy="#{l.warnActice}">
								<h:outputLabel value="#{l.warnActice}" />
							</p:column>
							<p:column headerText="异常激活率"  sortBy="#{l.rate}">
								<h:outputLabel value="#{l.rate}" />
							</p:column>
						</p:dataTable>
				    </p:tab>
				</p:tabView>
			</p:panel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>